import Vue from 'vue'
import Router from 'vue-router'
import RouterConfig from './modules' // 引入业务逻辑模块

const originalReplace = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalReplace.call(this, location).catch(err => err)
}

Vue.use(Router)

export default new Router({
  mode: 'hash',
  scrollBehavior: () => ({ y: 0 }),
  routes: RouterConfig
})
